import App from './App'
import {
	
	mixins
} from "./utils/config.js"

// 小数点计算
import math from "@/utils/calc.js"
Vue.prototype.math = math;
//请求接口挂载
import * as api from '@/api/index.js';
Vue.prototype.$api = api
// #ifndef VUE3
import Vue from 'vue'
// import './uni.promisify.adaptor'

// 路由
// import {
// 	router,
// 	RouterMount
// } from './router'
// Vue.use(router)
//========= 组件================
import leader from "@/components/index/leader/leader.vue"
import headerView from "@/components/headerView/headerView"
import divimg from "@/components/divImg/divImg"
Vue.component('leader', leader)
Vue.component('divimg', divimg)
Vue.component('headerView', headerView)
// ============全局挂载登录==============
import loginView from "@/components/login/login"
const DialogConstructor = Vue.extend(loginView)
let DialogConstructorDom = {
	el: document.createElement('div'),
	...mixins //将方法放入到dom中
}

//生成已经创建的实例
let hsDialogDom = new DialogConstructor(DialogConstructorDom)
//利用原生dom方法，将dom插入到body中
document.body.appendChild(hsDialogDom.$el)
Vue.prototype.loginCom = hsDialogDom
//调用组件中的方法
// hsDialogDom.open()
// ================================================

Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
	...App,
})
// #ifdef H5
// RouterMount(app, router, '#app')
// #endif
app.$mount()

// #endif

Vue.mixin(mixins);

// #ifdef VUE3
import {
	createSSRApp
} from 'vue'
export function createApp() {
	const app = createSSRApp(App)
	return {
		app,
	}
}
// #endif